package com.oneday.ashop.console.test;

import java.io.*;
import java.net.Socket;
import java.nio.channels.FileLockInterruptionException;

/**
 * Created by admin on 2016/7/3.
 */
public class SocketClient {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.1.100", 8081);
        FileInputStream fileInputStream = new FileInputStream(new File("C:\\Users\\admin\\Desktop\\000.jpg"));
        OutputStream os = socket.getOutputStream();
        byte[] bytes = new byte[1024];
        while (fileInputStream.read(bytes) != -1) {
            os.write(bytes);
        }
        os.flush();
        os.close();
        socket.close();
    }
}
